package cn.ilikes.tools.hbase.jpa.metadatas.elements;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import cn.ilikes.tools.hbase.jpa.metadatas.elements.EntityFields.EntityFieldsType;

public class EntityFieldsImpl implements EntityFields {

	private Field field;

	private IndexField indexField;

	private JPAField jPAField;

	private String fieldName;

	private Method getMethod;

	private Method setMethod;

	private EntityFieldsType entityFieldsType;
	
	/**
	 * 该字段是否存入 数据库
	 */
	private boolean save;

	public EntityFieldsImpl(EntityFieldsType entityFieldsType) {
		super();
		this.entityFieldsType = entityFieldsType;
	}

	public EntityFieldsType getEntityFieldsType() {
		return entityFieldsType;
	}

	public void setField(Field field) {
		this.field = field;
	}

	@Override
	public IndexField getIndexField() {

		return indexField;
	}

	@Override
	public Field getField() {

		return field;
	}

	@Override
	public boolean isIndexable() {

		return (indexField == null) ? false : true;
	}

	public void setIndexField(IndexField indexField) {
		this.indexField = indexField;
	}

	@Override
	public JPAField getjPAField() {
		return jPAField;
	}

	public void setjPAField(JPAField jPAField) {
		this.jPAField = jPAField;
	}

	@Override
	public String getFieldName() {

		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	@Override
	public Method getGetMethod() {

		return getMethod;
	}

	@Override
	public Method getSetMethod() {

		return setMethod;
	}

	public void setGetMethod(Method getMethod) {
		this.getMethod = getMethod;
	}

	public void setSetMethod(Method setMethod) {
		this.setMethod = setMethod;
	}

	public EntityFieldsImpl(String fieldName) {
		super();
		this.fieldName = fieldName;
	}

	public boolean isSave() {
		return save;
	}

	public void setSave(boolean save) {
		this.save = save;
	}

}
